#include "stdafx.h"
#include "gp_Ax2d.h"
#include "gp_Pnt2d.h"
#include "gp_Dir2d.h"
#include "gp_Trsf2d.h"
#include "gp_Vec2d.h"
#include "gp_Ax2d.h"


 gp_Ax2d::gp_Ax2d() : loc(0.,0.), vdir(1.,0.)
{ }

 gp_Ax2d::gp_Ax2d (const gp_Pnt2d& P,
			 const gp_Dir2d& V) : loc(P), vdir(V)
{ }

 void gp_Ax2d::SetLocation(const gp_Pnt2d& P)
{ loc = P; }

 void gp_Ax2d::SetDirection(const gp_Dir2d& V)
{ vdir = V; }

 const gp_Pnt2d& gp_Ax2d::Location () const
{ return loc; }

 const gp_Dir2d& gp_Ax2d::Direction () const
{ return vdir; }

 bool gp_Ax2d::IsNormal
(const gp_Ax2d& Other,
 const double AngularTolerance) const
{ return vdir.IsNormal(Other.vdir, AngularTolerance); }

 bool gp_Ax2d::IsOpposite
(const gp_Ax2d& Other,
 const double AngularTolerance) const
{ return vdir.IsOpposite (Other.vdir, AngularTolerance); }

 bool gp_Ax2d::IsParallel
(const gp_Ax2d& Other,
 const double AngularTolerance) const
{ return vdir.IsParallel(Other.vdir, AngularTolerance); }

   double gp_Ax2d::Angle (const gp_Ax2d& Other) const
{ return vdir.Angle (Other.vdir); }

 void gp_Ax2d::Reverse()
{ vdir.Reverse(); }

 gp_Ax2d gp_Ax2d::Reversed() const
{ 
  gp_Ax2d Temp = *this;
  Temp.Reverse ();
  return Temp;
}

 void gp_Ax2d::Rotate (const gp_Pnt2d& P,
			     const double Ang)
{
  loc.Rotate (P, Ang);
  vdir.Rotate (Ang);
}

 gp_Ax2d gp_Ax2d::Rotated (const gp_Pnt2d& P,
				 const double Ang) const
{
  gp_Ax2d A = *this;
  A.Rotate (P, Ang);
  return A;
}

 gp_Ax2d gp_Ax2d::Scaled (const gp_Pnt2d& P,
				const double S) const
{
  gp_Ax2d A = *this;
  A.Scale (P, S);
  return A;
}

 void gp_Ax2d::Transform (const gp_Trsf2d& T)
{
  loc.Transform  (T);
  vdir.Transform (T);
}

 gp_Ax2d gp_Ax2d::Transformed (const gp_Trsf2d& T) const
{
  gp_Ax2d A = *this;
  A.Transform (T);
  return A;
}

 void gp_Ax2d::Translate (const gp_Vec2d& V)
{ loc.Translate (V); }

 gp_Ax2d gp_Ax2d::Translated (const gp_Vec2d& V) const
{
  gp_Ax2d A = *this;
  (A.loc).Translate (V); 
  return A;
}

 void gp_Ax2d::Translate (const gp_Pnt2d& P1,
				const gp_Pnt2d& P2)
{ loc.Translate (P1,P2); }

 gp_Ax2d gp_Ax2d::Translated (const gp_Pnt2d& P1,
				    const gp_Pnt2d& P2) const
{
  gp_Ax2d A = *this;
  (A.loc).Translate( gp_Vec2d (P1, P2));
  return A;
}

